//线上接文档
// 如果没有通过拦截器配置域名的话，可以在这里写上完整的URL(加上域名部分)
let merchantLogin = '/mall-merchant/merchant/login';
let noticeHomePage = '/mall-merchant/merchant/admin/notice/homePage';
let activityListUrl = "/mall-merchant/merchant/admin/activity/list";
let bankUrl = '/merchant-server/open/data/wx/bank';
let activityDetails = "/mall-merchant/merchant/admin/activity/details";
let payChannel = '/merchant-server/merchant/pay-channel/wx-online';
let merchantInfo = '/merchant-server/merchant/info';
let wxOnlineInfo = '/merchant-server/merchant/wx-online/info';
let payChannelWxOnline = '/merchant-server/merchant/pay-channel/wx-online';
let applyWxOnline = '/merchant-server/merchant/pay-channel/apply/wx-online';
let orderAmount = '/mall-order/merchant/admin/order/order-amount/statistics';
let orderNum = '/mall-order/merchant/admin/order/order-num/statistics';
let productData = '/mall-product/merchant/admin/product/statistics';
//增值服务 start
let combo = '/mall-merchant/merchant/admin/combo';
let combBuy = '/mall-merchant/merchant/admin/combo/buy';
let combRenewal = '/mall-merchant/merchant/admin/combo/renewal';
let combUpgrade = '/mall-merchant/merchant/admin/combo/upgrade';
let combAvailable = '/mall-merchant/merchant/admin/combo/available';
//增值服务 end
let activityCancel = '/mall-merchant/merchant/admin/activity/cancel';
let merchantBalance = '/merchant-server/merchant/balance';
let sweet = '/mall-merchant/merchant/admin/sweet';
let sweetTransfer = '/mall-merchant/merchant/admin/sweet/transfer';
let merchantWithdraw = '/merchant-server/merchant/withdraw';
// 订单模块
let mallOrderDeliver = '/mall-order/merchant/admin/order/deliver';
let mallOrderUpdate = '/mall-order/merchant/admin/order/update';
let mallOrderDetails = '/mall-order/merchant/admin/order/details';
let mallOrderList = '/mall-order/merchant/admin/order/list';
let orderPickUp = '/mall-order/merchant/admin/order/pickUp';
let orderExcelExport = '/mall-order/merchant/admin/order/excel/export';
let mallOrderLogistics = '/mall-order/merchant/admin/order/logistics';

// 售后单
let afterSaleList = '/mall-order/merchant/admin/afterSale/list'; //售后单列表
let afterSaleDetail = '/mall-order/merchant/admin/afterSale/details'; //售后单列详情
let afterSaleRefund = '/mall-order/merchant/admin/afterSale/refund'; // 审核售后单
//商城分配记录 start
let statistics = '/mall-order/merchant/admin/record/statistics';
let record = '/mall-order/merchant/admin/record/list';
let transItems = '/mall-merchant/merchant/admin/sweet/transItems';
let sweetQuery = '/mall-merchant/merchant/admin/sweet/query';
//商品
let mallList = '/mall-product/merchant/admin/product';
let brand = '/mall-product/merchant/admin/product/brand/simple'; //获取品牌列表
let categorySi = '/mall-product/merchant/admin/product/category/simple'; //商家获取商品中的类目
let delProduct = '/mall-product/merchant/admin/product'; //商品删除
let productUndo = '/mall-product/merchant/admin/product/undo'; //商户撤销发布商品


//商城分配记录 end

// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	//检查版本更新,//检查版本更新
	let version = (params = {}) => vm.$u.get('/composite/app/check/version', params);
	//登录
	let login = (params = {}) => vm.$u.post(merchantLogin, params);
	//获取角色
	let roles = (params = {}) => vm.$u.get('/mall-merchant/merchant/roles', params);
	//获取公告列表
	let noticeList = (params = {}) => vm.$u.get(noticeHomePage);
	//获取活动列表
	let getActivityList = (params = {}) => vm.$u.get(activityListUrl, params);
	//获取开户银行全称
	let bankList = (params = {}) => vm.$u.get(bankUrl, params);
	//获取活动领取详情
	let getActivityDetails = (params = {}) => vm.$u.get(activityDetails, params);
	//查询商家订单金额统计数据
	let orderAmountStatistics = (params = {}) => vm.$u.get(orderAmount, params);
	//查询商家订单数量
	let orderNumStatistics = (params = {}) => vm.$u.get(orderNum, params);
	//统计商家商品数据
	let productDataStatistics = (params = {}) => vm.$u.get(productData, params);
	//查询支付渠道开通状态
	let getPayChannel = (params = {}) => vm.$u.get(payChannel);
	//查询商家对应支付渠道进件信息
	let getWxOnlineInfo = (params = {}) => vm.$u.get(wxOnlineInfo);
	//提交对应支付渠道的进件信息
	let payChannelWxOnlinePost = (params = {}) => vm.$u.post(payChannelWxOnline, params);
	//提交对应支付渠道的进件信息
	let payChannelWxOnlinePut = (params = {}) => vm.$u.put(payChannelWxOnline, params);
	//进件对应支付渠道的进件信息
	let applyWxOnlinepost = (params = {}) => vm.$u.post(applyWxOnline, params);
	//商户后台获取套餐服务
	let getCombo = (params = {}) => vm.$u.get(combo, params);
	//获取正在使用的套餐
	let getCombAvailable = (params = {}) => vm.$u.get(combAvailable, params);
	//购买套餐
	let postCombBuy = (params = {}) => vm.$u.post(combBuy, params);
	//续期套餐
	let postCombRenewal = (params = {}) => vm.$u.post(combRenewal, params);
	//升级套餐
	let postCombUpgrade = (params = {}) => vm.$u.post(combUpgrade, params);
	// 取消活动
	let putActivityCancel = (params = {}) => vm.$u.put(activityCancel, params);
	//查询商家余额
	let getMerchantBalance = (params = {}) => vm.$u.get(merchantBalance, params);
	//获取商户糖果账户
	let getSweet = (params = {}) => vm.$u.get(sweet + '/' + params);
	// 获取商户信息
	let getMerchantInfo = (params = {}) => vm.$u.get(merchantInfo);
	//糖果账户划转
	let postMerchantInfo = (params = {}) => vm.$u.post(sweetTransfer, params);
	//商家提现
	let postMerchantWithdraw = (params = {}) => vm.$u.post(merchantWithdraw, params);
	//订单发货
	let postMallOrderDeliver = (params = {}) => vm.$u.post(mallOrderDeliver, params);
	//修改订单收货信息
	let putMallOrderUpdate = (params = {}) => vm.$u.put(mallOrderUpdate, params);
	//新订单详情
	let getmallOrderDetails = (params = {}) => vm.$u.get(mallOrderDetails, params);
	//订单列表
	let getMallOrderList = (params = {}) => vm.$u.get(mallOrderList, params);
	//订单已提货
	let putOrderPickUp = (params = {}) => vm.$u.put(orderPickUp + '/' + params);
	// 订单导出
	let postOrderExcelExport = (params = {}) => vm.$u.post(orderExcelExport, params, {
		responseType: 'blob'
	});
	//售后单列表
	let getAfterSaleList = (params = {}) => vm.$u.get(afterSaleList, params);
	//售后单列详情
	let getAfterSaleDetail = (params = {}) => vm.$u.get(afterSaleDetail, params);
	// 审核售后单
	let postAfterSaleRefund = (params = {}) => vm.$u.post(afterSaleRefund, params);
	//分配统计
	let statisticsNums = (params = {}) => vm.$u.get(statistics, params);
	//商城分配记录列表
	let recordList = (params = {}) => vm.$u.get(record, params);
	//获取商户糖果账户提现记录列表
	let getTransItems = (params = {}) => vm.$u.get(transItems, params);
	//商户获取糖果账户明细记录
	let getSweetQuery = (params = {}) => vm.$u.get(sweetQuery, params);
	//查询物流
	let getMallOrderLogistics = (params = {}) => vm.$u.get(mallOrderLogistics, params);
	//查询商品列表
	let getGoodsList = (params = {}) => vm.$u.get(mallList, params);
	//获取品牌列表
	let brandList = (params = {}) => vm.$u.get(brand, params);
	//获取商家商品类目
	let categoryList = (params = {}) => vm.$u.get(categorySi, params);
	//获取运费列表
	let transportList = (params = {}) => vm.$u.get('/mall-product/merchant/admin/transport/list', params);
	//运费开关
	let transportUnload = (params = {}) => vm.$u.put('/mall-product/merchant/admin/transport/isActive', params);
	//删除商品
	let deleteProduct = (params = {}) => vm.$u.delete(delProduct+'/'+params.id);
	//撤销商品
	let productUndoPut = (params = {}) => vm.$u.put(productUndo+'/'+params.id);
	//商户发布商品
	let productSubmit = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product/submit',params);
	//商品上架下架
	let productXiajia = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product/status',params);
	//获取所有商品类目
	let category = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/category',params);
	//根据商家id 查询对应的运费模板
	let transport = (params = {}) => vm.$u.get('/mall-product/merchant/admin/transport/query',params);
	//获取糖果抵扣率配置
	let deductRate = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/deductRate',params);
	//计算返回商品当天实时参考价格
	let calculate = (params = {}) => vm.$u.post('/mall-product/merchant/admin/product/calculate',params);
	//获取按首字母排序的品牌列表
	let brandSort = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/brand/title/sort',params);
	//新增商品
	let addproduct = (params = {}) => vm.$u.post('/mall-product/merchant/admin/product',params);
	//商户后台获取商品详情
	let GoodsDetail = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/productInfo/'+params.id);
	//修改商品
	let updateProduct = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product',params);
	//统计商家商品数据
	let productStatistics = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/statistics',params);
	//删除商品媒体信息
	let delMediaImage = (params = {}) => vm.$u.delete('/mall-product/merchant/admin/product/media/'+params.id);
	//商户批量排序商品主图
	let mediaSort = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product/media/sort',params);
	//修改富文本商品详情
	let mediaDetails = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product/details',params);
	//富文本商品详情
	let goodsDetails= (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/mediaInfo/'+params.id);
	//商户获取商品参数信息
	let attrValueInfo = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/attrValueInfo/'+params.id);
	//商家运费模板数据统计
	let transportStatistics = (params = {}) => vm.$u.get('/mall-product/merchant/admin/transport/statistics',params);
	//获取问答列表详情
	let businessFaqDetail = (params = {}) => vm.$u.get('/composite/open/business/faq/' + params.id); 
	//获取营销案例详情
	let marketingCaseDetail = (params = {}) => vm.$u.get('/composite/open/business/marketing_case/' + params.id);
	// 获取问答中心列表
	let businessFaq = (params = {}) => vm.$u.get('/composite/app/business/faq', params);
	// 获取营销服务列表
	let marketingCase = (params = {}) => vm.$u.get('/composite/app/business/marketing_case', params);
	// 新增运费模板
	let transportAdd = (params = {}) => vm.$u.post('/mall-product/merchant/admin/transport/add', params);
	// 编辑运费模板
	let transportUpdate = (params = {}) => vm.$u.put('/mall-product/merchant/admin/transport/update', params);
	// 获取运费模板详情
	let transportEditDetail = (params = {}) => vm.$u.get('/mall-product/merchant/admin/transport/edit/list', params);
	// 查询城市信息
	let regionList = (params = {}) => vm.$u.get('/mall-product/merchant/admin/transport/region/list', params);
	//删除商品参数和参数值
	let delAttrValue = (params = {}) => vm.$u.delete('/mall-product/merchant/admin/product/attrValue/' + params.id);
	//批量新增商品参数和参数值
	let addAttrValue = (params = {}) => vm.$u.post('/mall-product/merchant/admin/product/attrValue',params);
	//批量更新商品参数和参数值
	let editAttrValue = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product/attrValue',params);
	//	商户获取商品sku分页列表
	let skuList = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/sku',params);
	//获取商品规格和属性列表
	let specList = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/spec',params);
	//新增商品规格
	let addSpec = (params = {}) => vm.$u.post('/mall-product/merchant/admin/product/spec',params);
	//删除商品规格
	let delSpec = (params = {}) => vm.$u.delete('/mall-product/merchant/admin/product/spec/'+ params.id);
	//编辑商品规格
	let editSpec = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product/spec',params);
	//新增商品规格属性
	let addSpecdetail = (params = {}) => vm.$u.post('/mall-product/merchant/admin/product/spec/detail',params);
	//删除商品规格属性
	let delSpecdetail = (params = {}) => vm.$u.delete('/mall-product/merchant/admin/product/spec/detail/'+ params.id);
	//编辑商品规格属性
	let editSpecdetail = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product/spec/detail',params);
	//单独添加商品sku
	let skuSingle = (params = {}) => vm.$u.post('/mall-product/merchant/admin/product/sku/single',params);
	//单独修改商品sku
	let EditSkuSingle = (params = {}) => vm.$u.put('/mall-product/merchant/admin/product/sku/single',params);
	//删除商品sku
	let delSku = (params = {}) => vm.$u.delete('/mall-product/merchant/admin/product/sku/'+ params.id);
	//查询商品sku详情
	let getSku = (params = {}) => vm.$u.get('/mall-product/merchant/admin/product/sku/'+ params.skuId);
	// 商家金豆明细
	let getGoldenBean = (params = {}) => vm.$u.get('/mall-merchant/merchant/admin/goldenBean/detail',params);
	//商家金豆划转
	let goldenBeanTransfer = (params = {}) => vm.$u.post('/mall-merchant/merchant/admin/goldenBean/transfer', params);
	// 查询商家金豆余额
	let getGoldenBeanTotal = (params = {}) => vm.$u.get('/mall-merchant/merchant/admin/goldenBean/getGoldenBean', params);
	//获取金豆的抵扣棵数和参考价格
	let getGoldenBeanPrice = (params = {}) => vm.$u.get('mall-product/merchant/admin/product/getGoldenBeanPrice', params);
	vm.$u.api = {
		version,
		regionList,
		transportEditDetail,
		transportUpdate,
		transportAdd,
		marketingCaseDetail,
		businessFaqDetail,
		businessFaq,
		marketingCase,
		login,
		roles,
		noticeList,
		getActivityList,
		bankList,
		getActivityDetails,
		orderAmountStatistics,
		orderNumStatistics,
		productDataStatistics,
		getMerchantInfo,
		getPayChannel,
		getWxOnlineInfo,
		payChannelWxOnlinePost,
		payChannelWxOnlinePut,
		applyWxOnlinepost,
		getCombo,
		getCombAvailable,
		postCombBuy,
		postCombRenewal,
		postCombUpgrade,
		bankList,
		getActivityDetails,
		getMerchantBalance,
		getSweet,
		getMerchantInfo,
		postMerchantInfo,
		postMerchantWithdraw,
		postMallOrderDeliver,
		putMallOrderUpdate,
		getmallOrderDetails,
		getMallOrderList,
		putOrderPickUp,
		postOrderExcelExport,
		getAfterSaleList,
		getAfterSaleDetail,
		postAfterSaleRefund,
		statisticsNums,
		recordList,
		getTransItems,
		getSweetQuery,
		getMallOrderLogistics,
		getGoodsList,
		brandList,
		categoryList,
		transportList,
		transportUnload,
		deleteProduct,
		productUndoPut,
		productSubmit,
		productXiajia,
		category,
		transport,
		deductRate,
		calculate,
		brandSort,
		addproduct,
		GoodsDetail,
		updateProduct,
		productStatistics,
		delMediaImage,
		mediaSort,
		mediaDetails,
		goodsDetails,
		attrValueInfo,
		transportStatistics,
		delAttrValue,
		addAttrValue,
		editAttrValue,
		skuList,
		specList,
		addSpec,
		delSpec,
		editSpec,
		addSpecdetail,
		delSpecdetail,
		editSpecdetail,
		skuSingle,
		delSku,
		getSku,
		EditSkuSingle,
		getGoldenBean,
		goldenBeanTransfer,
		getGoldenBeanTotal,
		getGoldenBeanPrice
	};
}

export default {
	install
}
